# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=rkward
pkgver=0.7.5
pkgrel=2
# armhf blocked by extra-cmake-modules
# s390x, ppc64le and riscv64 blocked by qt5-qtwebengine
arch="all !armhf !s390x !ppc64le !riscv64"
url="https://rkward.kde.org/"
pkgdesc="Easy extensible and easy-to-use IDE/GUI for R"
license="GPL-2.0-or-later"
depends="R"
makedepends="
	R-dev
	extra-cmake-modules
	kconfig5-dev
	kcoreaddons5-dev
	kdoctools5-dev
	ki18n5-dev
	knotifications5-dev
	kparts5-dev
	ktexteditor5-dev
	kwidgetsaddons5-dev
	kwindowsystem5-dev
	kxmlgui5-dev
	qt5-qtbase-dev
	qt5-qtwebengine-dev
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/education/rkward.git"
source="https://download.kde.org/stable/rkward/$pkgver/rkward-$pkgver.tar.gz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
247ee50fbebb9b74a1c03d6ef99dded18a1b3cf18286a6d2afcaa8ff7472cc3cb735db0a876926625aff4674906956f7a0c001a46d0dfd328a93e8c7af9f6c6b  rkward-0.7.5.tar.gz
"
